package com.hfy.music.mapper;

import com.hfy.model.Bo.SendUserNoticeBo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ author 韩
 * time: 2024/9/23 17:10
 */

@Mapper
public interface NoticeMapper {

    @Insert("INSERT INTO `notice` (`account`, `comment_id`, `do_comment_id`, `music_id`, type) VALUES (#{account}, #{commentId}, #{doCommentId} ,#{musicId}, #{type})")
    void InsertNotice(@Param("account") Long account, @Param("commentId") Integer commentIde
            , @Param("doCommentId") Integer doCommentId, @Param("musicId") Integer musicId, @Param("type") Integer type);

    @Select("SELECT id, account, comment_id commentId, do_comment_id doCommentId, type, music_id musicId FROM `notice` WHERE account = #{account} AND die=0")
    List<SendUserNoticeBo> getNoticesByAccount(@Param("account") Long account);
}
